`cutRSAndMeasurePredictQual` <-
function(ruleSet, testData, trainData, classes, name, rulesToCut)
{
	funs = c(qMD, qLS, qIS, qC1, personKsi2, qws, qProd)
	n = as.integer(round(rulesToCut*length(ruleSet)))
	sink(paste(name,".RS", sep=""))
	print(ruleSet)
	predictResult = predict.ruleset(ruleSet, testData, classes)
	print("predictResult")
	print(predictResult)
	predictQuality = classQual(predictResult, testData)
	print("predictQuality")
	print(predictQuality)
	sink()
	cutRuleSets = c()
	predictResults = c()
	predictResultsQuality = c()
	for(i in 1:length(funs)){
		sink(paste(name,"cut[[",i,"]].RS", sep=""))
		cutRuleSets[[i]] = cutRS(ruleSet, trainData, funs[[i]], n)
		print(cutRuleSets[[i]])
		predictResults[[i]] =  predict.ruleset(cutRuleSets[[i]], testData, classes)
		print(paste(name," predictResults[[",i,"]]", sep=""))
		print(predictResults[[i]])
		predictResultsQuality[[i]] = classQual(predictResults[[i]], testData)
		print(paste(name," predictResultsQuality[[",i,"]]", sep=""))
		print(predictResultsQuality[[i]])
		sink()
	}
}

